package com.ruoyi.business.payment.enums;

// 订单状态枚举
public enum PaymentOrderStatus {
    PENDING_PAYMENT(0, "待支付"),
    PAID(1, "已支付"),
    PAYMENT_FAILED(2, "支付失败"),
    CLOSED(3, "逾期订单"),
    REFUNDING(4, "退款中"),
    REFUNDED(5, "已退款");

    private final int code;
    private final String description;

    PaymentOrderStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String getNameByCode(Integer code) {
        for (PaymentOrderStatus enums : PaymentOrderStatus.values()) {
            if (enums.getCode()==code) {
                return enums.getDescription();
            }
        }
        return "";
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
